package com.example.myspringboot.design.factory.abstractTwo;

import com.example.myspringboot.design.factory.abstractTwo.concrete.ConcreteFactory1;
import com.example.myspringboot.design.factory.dto.ProductA;
import com.example.myspringboot.design.factory.dto.ProductB;

/**
 * @Author ZhengShan
 * @Date 2024 06 26 16 19
 **/
public class TestMain {

    public static void main(String[] args) {
        AbstractFactory abstractFactory1 = new ConcreteFactory1();
        ProductA productA = abstractFactory1.createProductA();
        ProductB productB = abstractFactory1.createProductB();
        productA.use();
        productB.use();

        AbstractFactory abstractFactory2 = new ConcreteFactory1();
        ProductA productA2 = abstractFactory2.createProductA();
        ProductB productB2 = abstractFactory2.createProductB();
        productA2.use();
        productB2.use();
    }
}
